<template>
  <view class="module-container">
    <view class="module-header">
      <text class="module-title">模块4</text>
      <text class="module-subtitle">我的收藏</text>
    </view>
    
    <view class="module-content">
      <view class="content-card">
        <image src="/static/icons/module4.svg" class="card-image" mode="aspectFit"></image>
        <text class="card-title">我的收藏内容</text>
        <text class="card-desc">查看您收藏的所有视频内容，方便您随时回顾喜欢的视频，管理您的收藏列表。</text>
        <button class="card-button" @click="manageCollection">管理收藏</button>
      </view>
      
      <view class="collection-list">
        <view class="collection-item" v-for="index in 4" :key="index">
          <view class="item-image">
            <image src="/static/logo.png" mode="aspectFill"></image>
          </view>
          <view class="item-info">
            <text class="item-title">收藏的视频标题 {{index}}</text>
            <text class="item-desc">收藏于：2023-12-{{index + 10}}</text>
          </view>
          <view class="item-actions">
            <view class="action-icon" @click.stop="playItem">
              <text>▶</text>
            </view>
            <view class="action-icon" @click.stop="removeItem">
              <text>✕</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 可以在这里添加需要的数据
    }
  },
  onLoad() {
    // 页面加载时的逻辑
  },
  methods: {
    manageCollection() {
      // 管理收藏的逻辑
      uni.showToast({
        title: '收藏管理功能即将上线',
        icon: 'none',
        duration: 2000
      })
    },
    playItem() {
      // 播放收藏视频的逻辑
      uni.showToast({
        title: '视频播放功能即将上线',
        icon: 'none',
        duration: 2000
      })
    },
    removeItem() {
      // 移除收藏的逻辑
      uni.showModal({
        title: '确认移除',
        content: '确定要从收藏中移除这个视频吗？',
        success: res => {
          if (res.confirm) {
            uni.showToast({
              title: '已从收藏中移除',
              icon: 'success',
              duration: 2000
            })
          }
        }
      })
    }
  }
}
</script>

<style scoped>
.module-container {
  padding: 20rpx;
  background: #f8f8f8;
  min-height: 100vh;
}

.module-header {
  padding: 60rpx 20rpx 40rpx;
  text-align: center;
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border-radius: 20rpx 20rpx 0 0;
  color: #fff;
}

.module-title {
  font-size: 48rpx;
  font-weight: bold;
  margin-bottom: 10rpx;
  display: block;
}

.module-subtitle {
  font-size: 28rpx;
  opacity: 0.9;
}

.module-content {
  background: #fff;
  border-radius: 0 0 20rpx 20rpx;
  padding: 40rpx 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}

.content-card {
  text-align: center;
  margin-bottom: 60rpx;
}

.card-image {
  width: 160rpx;
  height: 160rpx;
  margin: 0 auto 30rpx;
}

.card-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 20rpx;
  display: block;
}

.card-desc {
  font-size: 28rpx;
  color: #666;
  line-height: 40rpx;
  margin-bottom: 30rpx;
  display: block;
}

.card-button {
  width: 60%;
  height: 90rpx;
  line-height: 90rpx;
  font-size: 32rpx;
  color: #fff;
  background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
  border-radius: 45rpx;
  border: none;
}

.card-button:active {
  opacity: 0.9;
}

.collection-list {
  display: flex;
  flex-direction: column;
  gap: 30rpx;
}

.collection-item {
  display: flex;
  background: #f8f8f8;
  border-radius: 16rpx;
  overflow: hidden;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

.item-image {
  width: 200rpx;
  height: 200rpx;
  background: #e0e0e0;
}

.item-image image {
  width: 100%;
  height: 100%;
}

.item-info {
  flex: 1;
  padding: 30rpx;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 10rpx;
  display: block;
}

.item-desc {
  font-size: 24rpx;
  color: #999;
}

.item-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20rpx;
  gap: 20rpx;
}

.action-icon {
  width: 60rpx;
  height: 60rpx;
  border-radius: 50%;
  background: #fff;
  color: #667eea;
  font-size: 28rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.action-icon:nth-child(2) {
  color: #ff6b6b;
}
</style>